import React, { useContext } from 'react'
import './App.less'
import {Son1} from './Son1'
import Provider from './context/Provider'
import context from './context/context'

export const Header:React.FC =() => {
   const {dispatch, state} = useContext(context)
   console.log(state); //undefined 注意此组件不能拿到数据，因为没有被Provider包裹
    return (
      <>
      <Provider>
         <div className='head'>
            <span>我最大</span>
            <Son1></Son1>
         </div>
      </Provider>
       </>
    )
  }
